<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<META http-equiv="Content-Type" content="text/html; charset=windows-1251">
</head>

<body>
	
<?php
	require_once('params.inc');
	require_once('db.inc');
	
	$bannerId = $par->items['id'];
	
	$q = new Query($db);
	$q->exec('UPDATE cf_banners_stat SET clicked=clicked+1 WHERE banner_id='.$bannerId.' AND date=CURRENT_DATE');
	$q->exec('SELECT url FROM cf_banners WHERE id='.$bannerId);
	$row = $q->fetch();
	$target = 'http://'.$row[0];
?>

<script lang=javascript>
	window.location.href = '<?php echo $target;?>';
</script>

<h1><?php echo $target;?></h1>

</body>
</html>